package com.atguigu.controller;

import com.atguigu.pojo.User;
import lombok.Data;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @版本： V5.1.0
 * @版权： Copyright @ 2025 广东广昱信息科技有限公司版权所有
 * @作者： 广东广昱信息科技有限公司
 * @日期： 2025-07-04 22:06
 */
@RestController
@RequestMapping("user")
public class UserController {

    @GetMapping
    public List<User> page(@RequestParam(required = false,defaultValue = "1") int page,
                           @RequestParam(required = false,defaultValue = "10") int size){
        System.out.println("page = "+page+", size = "+size);
        return null;

    }

    @PostMapping
    public User save(@RequestBody User user){
        System.out.println("user = "+user);
        return user;
    }



    @GetMapping("{id}")
    public User detail(@PathVariable Integer id){

        return null;
    }

    @PutMapping
    public User update(@RequestBody User user){
        System.out.println("user = "+user);
        return user;
    }

    @DeleteMapping("{id}")
    public User delete(@PathVariable Integer id){
        return null;
    }

    @GetMapping("search")
    public List<User> search(String keywork,
                             @RequestParam(required = false,defaultValue = "1") int page,
                             @RequestParam(required = false,defaultValue = "10") int size){
        return null;
    }


}
